package com.smart.campus.controller;

import com.smart.campus.dto.SysUser;
import com.smart.campus.interfaces.SysUserServiceApi;
import com.smart.campus.pojo.PagedResponse;
import com.smart.campus.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SysUserController implements SysUserServiceApi {
    @Autowired
    private SysUserService sysUserService;

    @Override
    public List<SysUser> findUserList(SysUser sysUser) {
        return sysUserService.findUserList(sysUser);
    }

    @Override
    public PagedResponse<SysUser> pageUser(SysUser sysUser, Integer pageNum, Integer pageSize) {
        return sysUserService.pageUser(sysUser,pageNum,pageSize);
    }

    @Override
    public void addUser(SysUser sysUser) {
        sysUserService.addUser(sysUser);
    }

    @Override
    public void delUser(Long userId) {
        sysUserService.delUser(userId);
    }

    @Override
    public SysUser findUserById(Long userId) {
        return sysUserService.findUserById(userId);
    }

    @Override
    public void updateUser(SysUser sysUser) {
        sysUserService.updateUser(sysUser);
    }

    @Override
    public SysUser findSysUserByUserName(String username) {
        return sysUserService.findSysUserByUserName(username);
    }

    @Override
    public PagedResponse<SysUser> findAll(SysUser sysUser, Integer pageNum, Integer pageSize) {
        return sysUserService.findAll(sysUser,pageNum,pageSize);
    }

    @Override
    public List<SysUser> getTeachersList() {
        return sysUserService.getTeachersList();
    }

    @Override
    public void updateStatus(SysUser sysUser) {
        sysUserService.updateStatus(sysUser);
    }

    @Override
    public List<SysUser> getDetails(SysUser sysUser) {
        return sysUserService.getDetails(sysUser);
    }
}
